package com.woniu.adopt_web.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.adopt_web.entity.Activity;
import com.woniu.adopt_web.mapper.ActivityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ActivityService {

    @Autowired
    private ActivityMapper activityMapper;


    public PageInfo<Activity> queryAllByPage(Integer now , Integer size){
        PageHelper.startPage(now ,size);
        List<Activity> activities = activityMapper.selectAllByDisplayAndDel();
        return new PageInfo<>(activities);
    }

}
